package com.visikard.ui.activity;

import java.util.List;

import android.os.Bundle;
import android.os.Message;
import android.support.v4.app.Fragment;

import com.visikard.application.UIMessage;
import com.visikard.application.VKRegApplication;
import com.visikard.asynctask.BaseTask;
import com.visikard.asynctask.RequestRTUICouponTask;
import com.visikard.item.ItemRTUICoupon;
import com.visikard.ui.R;
import com.visikard.ui.fragment.RedeemNowFragment;

public class TestActivity extends BaseFragmentActivity {

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);

		setContentView(R.layout.test_activity);

		Fragment testFrag = new RedeemNowFragment();
		getSupportFragmentManager().beginTransaction().add(R.id.container, testFrag).commit();

		// BaseTask task = new GetRTUICouponTask(mHandler);
		// task.execute(VKRegApplication.merchantAccountObj.getMerchantIdFromRTUI());
		BaseTask task = new RequestRTUICouponTask(mHandler);
		task.execute(VKRegApplication.merchantAccountObj.getIdUsersMerchant(), "abc", "No112322", "hello");
	}

	@Override
	protected boolean handleMessage(Message msg) {
		switch (msg.what) {
			case UIMessage.MSG_GET_LIST_SUCCESS:
				List<ItemRTUICoupon> listCoupons = (List<ItemRTUICoupon>) msg.obj;
				return true;
		}
		return super.handleMessage(msg);
	}

}
